from django.shortcuts import render
from django.shortcuts import HttpResponse
from django.contrib.auth import authenticate
from django.views.decorators.http import require_http_methods
# 注册逻辑


@require_http_methods(['GET', 'POST'])
def account_register(request):
    account = request.GET.get('account')
    password = request.GET.get('password')
    # user = authenticate(request, username=username, password=password)
    return HttpResponse(f"你好，注册成功,账号为：{account},密码为：{password}")


def account_login(request):
    account = request.GET.get('account')
    password = request.GET.get('password')
    return HttpResponse(f"你好，登录成功,账号为：{account},密码为：{password}")


def user_search(request, user_id):
    user_id = user_id
    return HttpResponse(f"你好，查询成功,账号为：{user_id}")